<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位应用：父相子绝</title>
    <style>
        .parent{
            height:800px;
            width:800px;
            background: antiquewhite;
            position:relative;
        }
        .child{
            height:100px;
            width:100px;
            background: #54b9e2;
            position:absolute;
            left:100px;
            top:500px;
        }
        .child1{
            height:100px;
            width:100px;
            background: peru;
            position:absolute;
            border-radius: 50%;
            left:500px;
            top:300px;
        }
        .child2{
            height:100px;
            width:100px;
            background: purple;
            position:absolute;
            left:50%;
            margin-left:-50px;
            top:50%;
            margin-top:-50px;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child"></div>
        <div class="child1"></div>
        <div class="child2"></div>
    </div>
</body>
</html>